# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Analytics.V3.Model.ProfileFilterLink do
  @moduledoc """
  JSON template for an Analytics profile filter link.

  ## Attributes

  *   `filterRef` (*type:* `GoogleApi.Analytics.V3.Model.FilterRef.t`, *default:* `nil`) - Filter for this link.
  *   `id` (*type:* `String.t`, *default:* `nil`) - Profile filter link ID.
  *   `kind` (*type:* `String.t`, *default:* `analytics#profileFilterLink`) - Resource type for Analytics filter.
  *   `profileRef` (*type:* `GoogleApi.Analytics.V3.Model.ProfileRef.t`, *default:* `nil`) - View (Profile) for this link.
  *   `rank` (*type:* `integer()`, *default:* `nil`) - The rank of this profile filter link relative to the other filters linked to the same profile.
      For readonly (i.e., list and get) operations, the rank always starts at 1.
      For write (i.e., create, update, or delete) operations, you may specify a value between 0 and 255 inclusively, [0, 255]. In order to insert a link at the end of the list, either don't specify a rank or set a rank to a number greater than the largest rank in the list. In order to insert a link to the beginning of the list specify a rank that is less than or equal to 1. The new link will move all existing filters with the same or lower rank down the list. After the link is inserted/updated/deleted all profile filter links will be renumbered starting at 1.
  *   `selfLink` (*type:* `String.t`, *default:* `nil`) - Link for this profile filter link.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :filterRef => GoogleApi.Analytics.V3.Model.FilterRef.t() | nil,
          :id => String.t() | nil,
          :kind => String.t() | nil,
          :profileRef => GoogleApi.Analytics.V3.Model.ProfileRef.t() | nil,
          :rank => integer() | nil,
          :selfLink => String.t() | nil
        }

  field(:filterRef, as: GoogleApi.Analytics.V3.Model.FilterRef)
  field(:id)
  field(:kind)
  field(:profileRef, as: GoogleApi.Analytics.V3.Model.ProfileRef)
  field(:rank)
  field(:selfLink)
end

defimpl Poison.Decoder, for: GoogleApi.Analytics.V3.Model.ProfileFilterLink do
  def decode(value, options) do
    GoogleApi.Analytics.V3.Model.ProfileFilterLink.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.Analytics.V3.Model.ProfileFilterLink do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
